package web.User;

import services.UserServiceAll;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/DelUserInfo")
public class DelUserInfo extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        int uid = Integer.parseInt(req.getParameter("delUid"));
        resp.setContentType("application/json");
        int num = new UserServiceAll().dele(uid);
        if (num > 0) {
            resp.getWriter().println("删除成功");
        } else {
            resp.getWriter().println("删除失败");
        }
    }
}
